package com.cyt.work.association.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import com.cyt.work.association.model.vo.WxAssociationNewDetailVo;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 社团招新管理-社团招新管理实体类
 *
 * @author han jun
 * @date 2019-8-30 16:17:54
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_wx_association_new")
public class WxAssociationNew implements Serializable {

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
     * 模块ID
     */ 
	@Column(name = "apply_id")
	private String applyId;

	/**
     * 社团招新名称
     */ 
	@Column(name = "title")
	private String title;

	/**
     * 招新开始日期
     */ 
	@Column(name = "begin_date")
	private Date beginDate;

	/**
     * 招新结束日期
     */ 
	@Column(name = "end_date")
	private Date endDate;

	/**
     * 招新开始时间
     */ 
	@Column(name = "begin_time")
	private String beginTime;

	/**
     * 招新结束时间
     */ 
	@Column(name = "end_time")
	private String endTime;

	/**
     * 招新限制学生报名人数，即这次招新允许学生报名社团数
     */ 
	@Column(name = "max_asso_num")
	private String maxAssoNum;

	/**
     * 招新状态：0-即将开始，1-进行中2-已结束，3-编辑中
     */ 
	@Column(name = "status")
	private String status;

	/**
     * 是否删除：1-未删除；2-已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 更新人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	@Transient
	private Map<String, WxAssociationNewDetailVo> assNewDetailMap;

	/**
	 * 创建对象
	 *
	 * @param sysUser 当前用户信息
	 * @author han jun
	 * @date 2019-8-30 16:17:54
	 */
	public WxAssociationNew(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}